function SearchUninstall($SearchFor, $SearchVersion, $UninstallKey)
{
$uninstallObjects = ls -path $UninstallKey;
$found = $FALSE;

foreach($uninstallEntry in  $uninstallObjects)
{
   $entryProperty = Get-ItemProperty -path registry::$uninstallEntry
   if($entryProperty.DisplayName -like $searchFor)
    {
	   $vc1 = new-Object System.Version($entryProperty.DisplayVersion);
       $vc2 = new-Object System.Version($searchVersion);
       
       if($vc1.CompareTo($vc2) -ne -1)
	   {
         $found = $TRUE;
         break;
	   }
    }
}

$found;
}

# $res1 = SearchUninstall -SearchFor 'Windows Azure SDK' -SearchVersion '1.1.10131.1838' -UninstallKey 'HKLM:SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\';
# $res2 = SearchUninstall -SearchFor 'Windows Azure SDK' -SearchVersion '1.1.10131.1838' -UninstallKey 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\';

$res1 = SearchUninstall -SearchFor 'Windows Azure SDK' -SearchVersion '1.0.1015.1049' -UninstallKey 'HKLM:SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\';
$res2 = SearchUninstall -SearchFor 'Windows Azure SDK' -SearchVersion '1.0.1015.1049' -UninstallKey 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\';

($res1 -or $res2)